GXWriteData
QuickDraw GX sends theGXWriteData
message to send data directly to the device, without buffering. You can override theGXWriteData
message to provide your own I/O mechanism. Your override of theGXWriteData
message must match the following formal declaration:
OSErr MyWriteData (Ptr data, long length);
data
- A pointer to the data to send to device.
length
- The number of bytes of data.
- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
TheGXWriteData
message sends unbuffered data to a device and waits for I/O to complete.The default implementation of this message calls the asynchronous I/O functions of the Macintosh system software to send the data to the device. The default implementation then flushes the buffers, sends the resulting data through, and waits for the I/O operation to complete.
You can override this message as part of implementing your own I/O and buffering mechanism or changing how I/O is performed with your device.
SPECIAL CONSIDERATIONS
You can use theGXWriteData
message yourself to send data to your device without buffering or to force the buffers to be flushed.If you are implementing your own I/O mechanism, you need to totally override the
GXWriteData
message. If you are using the standard QuickDraw GX buffering and Macintosh I/O system, you must forward this message.RESULT CODES
The default implementation of the
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. GXWriteData
message can also return the communications errors that are listed in Table 4-2 on page 4-42.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help